package com.woniuxy.rabbitMq.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TopicConfig {
    @Bean
    public TopicExchange topicExchange(){
        return new TopicExchange("topicExchange");
    }
    @Bean
    public Queue topicQueueA(){
        return new Queue("topicQueueA");
    }
    @Bean
    public Queue topicQueueB(){
        return new Queue("topicQueueB");
    }


    @Bean
    public Binding binding21(){
        return BindingBuilder.bind(topicQueueA()).to(topicExchange()).with(".CAT");
    }
    @Bean
    public Binding binding22(){
        return BindingBuilder.bind(topicQueueB()).to(topicExchange()).with("#.CAT");
    }
}
